//
//  MyRoadShowController.m
//  BigToBig
//
//  Created by liuyi on 7/21/16.
//  Copyright © 2016 cn.cloudtp. All rights reserved.
//

#import "MyRoadShowController.h"
#import "MyRoadShowCell.h"
#import "RoadShowCheckController.h"

@interface MyRoadShowController ()
<
    UITableViewDelegate,
    UITableViewDataSource
>
@property (nonatomic, strong)UITableView *mainTableView;

@end

@implementation MyRoadShowController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    // 创建mainTableView
    self.mainTableView.backgroundColor = [UIColor whiteColor];
    self.mainTableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight - 84 - 20)];
    [self.view addSubview:self.mainTableView];
    self.mainTableView.delegate = self;
    self.mainTableView.dataSource = self;
    [self.mainTableView registerClass:[MyRoadShowCell class] forCellReuseIdentifier:NSStringFromClass([MyRoadShowCell class])];
    self.mainTableView.separatorStyle = NO;
    self.mainTableView.bounces = NO;
    
}

#pragma mark - tableView 代理方法
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 150;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 10;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    MyRoadShowCell *cell = [self.mainTableView dequeueReusableCellWithIdentifier:NSStringFromClass([MyRoadShowCell class]) forIndexPath:indexPath];
    cell.cellType = YES;
    cell.selectionStyle = UITableViewCellSelectionStyleNone;

    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    RoadShowCheckController *roadShowCheckC = [[RoadShowCheckController alloc]init];
    [self.navigationController pushViewController:roadShowCheckC animated:YES];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
